//
//  Auction_performanceSpecial_TbvCell_WX.m
//  ZITHER
//
//  Created by weixin on 2019/6/1.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "Auction_performanceSpecial_TbvCell_WX.h"

@implementation Auction_performanceSpecial_TbvCell_WX

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = HexColor(0xeeeeee);
    [self setUI];
}


- (void)setModelSub:(specialSaleStatusSubModel *)modelSub{
    _modelSub = modelSub;
    [self.Pic sd_setImage:modelSub.cover];
    
    self.TitleLab.text = modelSub.name;
    
    if ([modelSub.annotation.remainingTime isEqualToString:@"0"]) {
        self.TitleSubLab.textColor = HexColor(0x999999);
        self.TitleSubLab.text = @"暂无专场，请稍后";
    }else{
        self.TitleSubLab.textColor = HexColor(0xff6f6f);
        self.TitleSubLab.text = @"下一场开卖时间";
    }
 

    /**
     
     @property (nonatomic,strong)BaseImageV * Pic;
     
     @property (nonatomic,strong)BaseLab * TitleLab;
     
     @property (nonatomic,strong)BaseLab * TitleSubLab;
     
     @property (nonatomic,strong)BaseLab * TitlePicLab;
     
     @property (nonatomic,strong)BaseLab * TitleSubPicLab;
     
     */

    
}

-(void)setUI{
    
    [self.TitleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.top.equalTo(self).offset(20);
        make.height.mas_equalTo(20);
    }];
    [self.TitleSubLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.TitleLab).offset(0);
        make.right.equalTo(self).offset(-15);
        make.height.mas_equalTo(16);
    }];
    
    [self.Pic mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.TitleSubLab.mas_bottom).offset(20);
        make.left.right.equalTo(self).offset(15);
        make.right.equalTo(self).offset(-15);
        make.height.mas_equalTo((kScreenW-30)/360.0*180);
        make.bottom.equalTo(self).offset(0);
    }];
    
    [self.TitlePicLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.Pic).offset(15);
        make.top.equalTo(self.Pic).offset(30);
        make.height.mas_equalTo(20);
    }];
    
    [self.TitleSubPicLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.Pic).offset(15);
        make.top.equalTo(self.TitlePicLab.mas_bottom).offset(10);
        make.height.mas_equalTo(18);
    }];
    
}

- (BaseImageV *)Pic{
    if (!_Pic) {
        _Pic = [BaseImageV initCustom:CGRectZero contentMode:2];
        _Pic.backgroundColor = [UIColor redColor];
        [_Pic setCornerRadiusWithRadius:10 isMasks:YES];
        [self addSubview:_Pic];
    }
    return _Pic;
}

- (BaseLab *)TitleLab{
    if (!_TitleLab) {
        _TitleLab = [BaseLab initCustomLab:@"专场头部标题" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFangSC-Semibold" size:20]];
        _TitleLab.backgroundColor = [UIColor clearColor];
        
        [self addSubview:_TitleLab];
    }
    return _TitleLab;
}

- (BaseLab *)TitleSubLab{
    if (!_TitleSubLab) {
        _TitleSubLab = [BaseLab initCustomLab:@"专场头部子标题" color:[UIColor whiteColor] font:[UIFont fontWithName:@"PingFang-SC-Regular" size:15]];
        _TitleSubLab.textAlignment = 1;
        _TitleSubLab.backgroundColor = HexColor(0x333333);
        _TitleSubLab.textColor = [UIColor whiteColor];
        [_TitleSubLab setCornerRadiusWithRadius:2 isMasks:YES];
        _TitleSubLab.backgroundColor = [UIColor clearColor];

        [self addSubview:_TitleSubLab];
    }
    return _TitleSubLab;
}

- (BaseLab *)TitlePicLab{
    if (!_TitlePicLab) {
        _TitlePicLab = [BaseLab initCustomLab:@"图片主标题" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:15]];
        _TitlePicLab.backgroundColor = [UIColor clearColor];
        _TitlePicLab.hidden = YES;
        [self addSubview:_TitlePicLab];
    }
    return _TitlePicLab;
}

- (BaseLab *)TitleSubPicLab{
    if (!_TitleSubPicLab) {
        _TitleSubPicLab = [BaseLab initCustomLab:@"图片子标题" color:HexColor(0x333333) font:[UIFont fontWithName:@"PingFang-SC-Regular" size:15]];
        _TitleSubPicLab.backgroundColor = [UIColor clearColor];
        _TitleSubPicLab.hidden = YES;
         [self addSubview:_TitleSubPicLab];
    }
    return _TitleSubPicLab;
}


/**
 Pic;
 
 TitleLab;
 
 TitleSubLab;
 
 TitlePicLab;
 
TitleSubPicLab;
 */
@end
